<template>
	<view>
		<video id="myVideo" src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4" controls
			object-fit='fill'></video>
		<view class="box">
			<view class="title">课程内容</view>
			<view class="substance">
				为帮助广大教师完善授课体系、提高教育水平，教育部教育管理中心携手百度课程，将于2024年10月-2024-12月为大家献上‘信息技术与教育教学深度融合典型案例研究中心’之中小学教师公开课。</view>
		</view>

		<view v-if="list.length > 0">
			<view class="nav" v-for="(item,index) in list" :key="index">
				<view class="left">
					<view class="details">
						<view class="title">视频标题.MP4</view>
						<view class="speciality">金额：￥10</view>
					</view>
				</view>
				<image class="right"
					:src="listIndex==index?'https://img.wilmer.com.cn/admin/2024/3-26/Group%20322.png':'https://img.wilmer.com.cn/admin/2024/3-26/Group%20324.png'"
					mode=""></image>
			</view>
		</view>
		<image v-if="list.length == 0" class="NoData" src="https://img.wilmer.com.cn/admin/2024/3-20/WechatIMG19.jpg"
			mode=""></image>
	</view>
</template>

<script>
	import {
		getvedio,
		vedio
	} from '@/common/api/homePage.js'
	export default {
		data() {
			return {
				list: ['', '', ''], // 推荐院校
				listIndex: 0,
				information: ''
			}
		},
		methods: {
			onclick(item, index) {
				uni.showLoading({
					title: '加载中'
				});
				setTimeout(() => {
					uni.hideLoading();
				}, 1500)
				this.listIndex = index
				vedio(item.id).then(ren => {
					this.information = ren.data.data.vedio
					this.$forceUpdate()
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	#myVideo {
		width: 100vw;
		height: 440rpx;
		margin: 20rpx auto 0;
		display: block;
	}

	.box {
		width: 686rpx;
		height: 210rpx;
		background: #F9F9F9;
		margin: 50rpx auto 0;
		padding-top: 30rpx;

		.title {
			text-align: center;
			font-family: PingFang SC;
			font-size: 28rpx;
			font-weight: 400;
			color: #666666;
		}

		.substance {
			width: 628rpx;
			font-family: PingFang SC;
			font-size: 24rpx;
			font-weight: 400;
			color: #666666;
			line-height: 1.2;
			margin: 20rpx auto 0;
		}
	}

	.uni-ellipsis-1 {
		display: -webkit-box;
		overflow: hidden;
		text-overflow: ellipsis;
		word-wrap: break-word;
		white-space: normal !important;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
	}

	.nav {
		margin-top: 12rpx;
		width: 100vw;
		height: 160rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		background-color: #fff;
		border-bottom: 12rpx solid #F8F8F8;

		.left {
			margin-left: 48rpx;
			display: flex;

			.details {
				display: flex;
				flex-direction: column;

				.title {
					font-family: PingFang SC;
					font-size: 36rpx;
					font-weight: 500;
					letter-spacing: 0.03em;
					color: #666666;
				}

				.speciality {
					margin-top: 10rpx;
					font-family: PingFang SC;
					font-size: 24rpx;
					font-weight: 400;
					color: #999999;
				}
			}
		}

		.right {
			width: 44rpx;
			height: 40rpx;
			min-width: 44rpx;
			min-height: 40rpx;
			margin-right: 44rpx;
		}
	}

	.NoData {
		display: block;
		width: 400rpx;
		height: 318rpx;
		margin: 40rpx auto 0;
	}
</style>